package com.hetwen.search.activity;

import android.content.Intent;

import com.hetwen.search.R;
import com.hetwen.search.activity.base.BaseActivity;
import com.umeng.analytics.MobclickAgent;
import com.umeng.message.PushAgent;

public class SplashActivity extends BaseActivity {

	@Override
	protected void loadView() {
		setContentView(R.layout.activity_splash);
	}

	@Override
	protected void initView() {
		
	}

	@Override
	protected void initData() {
		/**
		 * 友盟统计
		 */
		MobclickAgent.setDebugMode(false);
		MobclickAgent.openActivityDurationTrack(false);
		MobclickAgent.updateOnlineConfig(this);
		
		/**
		 * 友盟推送
		 */
		PushAgent.getInstance(this).enable();
		PushAgent.getInstance(this).onAppStart();
		
		toMain(2000);
	}

	private void toMain(int delay) {
		mHandler.postDelayed(new Runnable() {
			@Override
			public void run() {
				Intent intent = new Intent(mContext,MainActivity.class);
				startActivity(intent);
				finish();
			}
		}, delay);
	}

}
